﻿using Mammoth.Entities;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Mammoth.Data
{
    public class MammothDataContext : DbContext, IMammothDataContext
    {
        public MammothDataContext() : base("MammothData") { }

        public IDbSet<AccountEntity> Accounts { get; set; }
        public IDbSet<UserEntity> Users { get; set; }
        public IDbSet<InboxEntity> Inboxes { get; set; }
        public IDbSet<OutboxEntity> Outboxes { get; set; }

        protected override void OnModelCreating(DbModelBuilder mb)
        {
            base.OnModelCreating(mb);

            mb.Entity<AccountEntity>().ToTable("tbl_account");
            mb.Entity<UserEntity>().ToTable("tbl_user");
            mb.Entity<InboxEntity>().ToTable("tbl_inbox");
            mb.Entity<OutboxEntity>().ToTable("tbl_outbox");
        }
    }
}
